home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / WINSOCK.PAK / DLGSTRM.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  2KB  |  53 lines

  1. #if !defined(DLGSTRM_H)
  2. #define DLGSTRM_H
  3.  
  4. #include <owl/defs.h>
  5. #include <owl/dialog.h>
  6. #include <owl/edit.h>
  7. #include <owl/button.h>
  8. #include <owl/winsock.h>
  9. #include "sockdemo.rh"
  10.  
  11. class DlgSendStream : public TDialog {
  12. public:
  13.    enum              nState{nIdle, nWaitingForAddress, nConnecting, nConnected} myPresentState;
  14.  
  15.    TEdit*            editAddressSend;
  16.    TEdit*            editAddressReceive;
  17.    TEdit*            editDataSend;
  18.    TEdit*            editDataReceive;
  19.    TEdit*            editPort;
  20.    TStatic*          staticStatus;
  21.    TButton*          btnConnectDisconnect;
  22.  
  23.    TStreamSocket*     myStreamSocket;
  24.    char               szDataToSend[256];
  25.    bool               bDataSent;
  26.    TINetSocketAddress sAddressToConnectTo;
  27.    THostInfoManager   myHostInfoManager;
  28.  
  29.    DlgSendStream(TWindow* parent, TResId resId = IDD_STREAM,
  30.                  TModule* module = 0);
  31.   ~DlgSendStream();
  32.    void SetupWindow();
  33.    short ConnectWithThis(TStreamSocket& newConnectedSocket);
  34.    short ConnectWithThis(SOCKET& newSocket, TSocketAddress& sNewAddress);
  35.    void CmBtnSend();
  36.    void CmBtnSendClear();
  37.    void CmBtnReceiveClear();
  38.    void CmConnectDisconnect();
  39.    void CmOk();
  40.    void Connect();
  41.    void SendData();
  42.    void ReadData();
  43.    void GoToIdleState();
  44.    void GoToWaitingForAddressState();
  45.    void GoToConnectingState();
  46.    void GoToConnectedState();
  47.    LRESULT DoHostNotification(WPARAM, LPARAM lParam);
  48.    LRESULT DoSocketNotification(WPARAM, LPARAM lParam);
  49.    DECLARE_RESPONSE_TABLE(DlgSendStream);
  50. };
  51.  
  52. #endif  // DLGSTRM_H
  53.